package cn.wolfcode.tieba.service.impl;

import cn.wolfcode.tieba.domain.Posted;
import cn.wolfcode.tieba.mapper.PostedMapper;
import cn.wolfcode.tieba.query.PostedQuery;
import cn.wolfcode.tieba.service.IPostedService;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

/**
* 发帖表服务接口实现
*/
@Service
@Transactional
public class PostedServiceImpl extends ServiceImpl<PostedMapper,Posted> implements IPostedService  {

    @Override
    public IPage<Posted> queryPage(PostedQuery qo) {
        IPage<Posted> page = new Page<>(qo.getCurrentPage(), qo.getPageSize());
        QueryWrapper<Posted> wrapper = Wrappers.<Posted>query();
        return super.page(page, wrapper);
    }
}
